package br.com.dp.dao.entidade;

import java.io.Serializable;
import javax.persistence.*;
import java.util.List;


/**
 * The persistent class for the status_reserva database table.
 * 
 */
@Entity
@Table(name="status_reserva")
@NamedQuery(name="StatusReserva.findAll", query="SELECT s FROM StatusReserva s")
public class StatusReserva implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@Column(unique=true, nullable=false)
	private int id;

	@Column(nullable=false, length=45)
	private String descricao;

	//bi-directional many-to-one association to Reserva
	@OneToMany(mappedBy="statusReserva")
	private List<Reserva> reservas;

	public StatusReserva() {
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescricao() {
		return this.descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	public List<Reserva> getReservas() {
		return this.reservas;
	}

	public void setReservas(List<Reserva> reservas) {
		this.reservas = reservas;
	}

	public Reserva addReserva(Reserva reserva) {
		getReservas().add(reserva);
		reserva.setStatusReserva(this);

		return reserva;
	}

	public Reserva removeReserva(Reserva reserva) {
		getReservas().remove(reserva);
		reserva.setStatusReserva(null);

		return reserva;
	}

}